<template>
  <Cascader
    v-bind="$attrs"
    v-on="$listeners"
    @change="handleChange"
    ref="cascader"
  >
    <slot name="empty"></slot>
    <template slot-scope="{ node, data }">
      <template v-if="$slots.default">
        <slot :node="node" :data="data"></slot>
      </template>
      <template v-else>
        <span class="one_line" :title="node.label">{{node.label}}</span>
      </template>
    </template>
  </Cascader>
</template>
<script>
import { Cascader } from "element-ui";
export default {
  components: {
    Cascader
  },
  props: {
    
  },
  data() {
    return {};
  },
  methods: {
    /**
     * @name handleChange
     * @description 切换
     * @author cjs1992
     * @date 2019-11-11 14:14:25
     */
    handleChange (val) {
      // 选中切换后是否仍然展示
      if (this.$attrs.changeShow || (this.$attrs.props && this.$attrs.props.multiple)) {
        return;
      }
      this.$refs.cascader.dropDownVisible = false;
      // this.$emit('change', val);
    }
  }
};
</script>